<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let arr = [1, 6, 9, 10]
        let arr2 = []
        let num = +prompt('请输入一个数字')
        function newArr(arr) {
            console.log(arr)
            for (let i = 0; i < arr.length; i++) {
                // 如果数组中的数组大于num就是删除
                if (arr[i] > num) {
                    arr2.push(arr[i])

                } if (arr2.length === 0) {
                    return null
                }

            }
            return arr2

        }
        console.log(newArr(arr))


    </script>

</body>

</html>